<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<html>
<head>

<title>新闻管理系统后台管理</title>
<%--<link href="${pageContext.request.contextPath}/images/style.css" rel="stylesheet" type="text/css">--%>
    <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
<style type="text/css">
<!--
body {background-color: #044668;}
-->
</style>
</head>
<body>
<form  name="add" method="post" action="${pageContext.request.contextPath}/login">
<div style="padding-top:120px;">
	<p style="color:#FFF;font-size:28px;font-weight:bolder;text-align:center;margin:10px;">新闻管理系统后台管理</p>
      <table width="641" border="0" align="center">
  <tr>
    <td width="641" height="232" align="right" background="images/bg.jpg">
	<div align="center">
	<table width="400" border="0" style="border-width:0px; ">
        ${msg}
      <tr>
        <td width="248" style="border-style: none; border-width: medium; "><table width="100%" border="0">
          <tr>
            <td width="40%">
			<p align="right"><b>用户名：</b></td>
            <td width="60%">
                <input id="username" name="username" type="text" size="15"
                       placeholder="登录账号" on/></td>
          </tr>
          <tr>
            <td>
			<p align="right"><b>密&nbsp;&nbsp;&nbsp; 码：</b></td>
            <td><input name="password" type="password" size="15" placeholder="登录密码"  /></td>
          </tr>
          <tr>
            <td>

			<p align="right"><b>&nbsp; 验 证 码：</b></td>
            <td align="left" valign="middle">
			<input name="VerifyCode" type="text"  id="VerifyCode" size="8" maxlength="6" placeholder="验证码" />
            <input type="button" value="获取" href="javascript:" onclick="sendMsg()"></input>
            </td>
          </tr>
<%--          <tr>--%>
<%--              <td>--%>
<%--                  <img alt="" src="${pageContext.request.contextPath}/checkString" id="v" align="right"/>--%>
<%--                  <a href="javascript:" onclick="_chage()" style="text-decoration: none;color: black">看不清,请换一张</a>--%>
<%--              </td>--%>
<%--          </tr>--%>
        </table></td>
        <td width="142" style="border-style:none; border-width:medium; ">
            <input border=0 cache height=89 src="images/login.jpg"
                   type=image width=82 name="image"></td>
      </tr>
    </table></div>
	</td>
  </tr>
</table>
</div>
</form>
<script type="text/javascript">
    function _chage() {
        var img=document.getElementById("v");
        img.src="${pageContext.request.contextPath}/checkString?a="+new Date().getTime();
    }
    function sendMsg() {
        var input = document.getElementById("username").value;
        console.log(input);
        <%--window.location.href="${pageContext.request.contextPath}/getMsg/"+input--%>
        $.ajax({
            url : "${pageContext.request.contextPath}/getMsg/"+input,
            type : "GET",
            dataType : "json",
            success : function(data){
                console.log("AJAX成功")
                if(data!=null){
                    $(data).each(function(index){

                    });
                }
            }
        });
    }
</script>
</body>
</html>